<div class="dux-tools">

  <div class="bread-head">{$class_info.name}管理 <span class="small"></span> </div>

  <br>

  <div class="tools-function clearfix">

    <div class="float-left"> <a class="button button-small bg-main icon-list" href="__URL__/index/id-{$class_info.cid}"> 内容列表</a> </div>

    <div class="button-group float-right"> <a class="button button-small bg-dot icon-plus dropdown-toggle"> 添加内容 <span class="downward"></span></a>

      <ul class="drop-menu pull-right">

        <?php if(model('user_group')->model_power('content','add')){ ?>

        <li><a href="__URL__/add/cid-{$class_info.cid}">添加内容</a></li>

        <?php } ?>

      </ul>

    </div>

  </div>

</div>

<div class="admin-main">

  <form action="__URL__/{$action}_save/time-<?php echo time(); ?>-ajax-true" class="form-x dux-form form-auto" id="form" name="form" method="post" autocomplete="off">

    <div class="tab dux-tab">

      <div class="panel dux-box  active">

        <div class="panel-head">

          <div class="tab-head"> <strong>{$model_info.name}{$action_name}</strong>

            <ul class="tab-nav">

              <li class="active"><a href="#tab-1">基本内容</a> </li>

              <li><a href="#tab-2">SEO设置</a> </li>

              <li><a href="#tab-3">其它设置</a> </li>

            </ul>

          </div>

        </div>

        <div class="tab-body">

          <div class="tab-panel active" id="tab-1">

            <div class="form-group">

              <div class="label">

                <label>栏目</label>

              </div>

              <div class="field">

                <select name="cid"  reg="." id="cid" msg="栏目未选择" onChange="get_fields()" class="input" >

              <option value="">======选择栏目======</option>

              <!--foreach:{$category_list $vo}--> 

              <option value="{$vo['cid']}" <?php if($class_info['cid']==$vo['cid']) { ?> selected="selected" <?php } ?> 

                  <?php if($vo['type']==0 || $vo['mid']<>$model_info['mid'] || !model('user_group')->class_power($vo['cid']) ){ ?>style="background-color:#ccc"  disabled="disabled" <?php } ?>

              >

                  {$vo['cname']}

              </option>

              <!--{/foreach}-->

            </select>

                <div class="input-note">请选择信息所属栏目</div>

              </div>

            </div>

            <div class="form-group">

              <div class="label">

                <label>标题</label>

              </div>

              <div class="field">

                <input name="title" type="text" class="input" id="title" style="width:360px;" value="{$info.title}" reg="\S" msg="标题不能为空" /><div class="corol_button"></div>

            <div onclick="fontbold()" class="bold_button"></div>

            <input id="font_color" name="font_color" type="hidden" value="{$info.font_color}" />

            <input id="font_bold" name="font_bold" type="hidden" value="{$info.font_bold}" />

                <div class="input-note">搜索引擎所收录的关键词</div>

              </div>

            </div>

            <div class="form-group">

              <div class="label">

                <label>推荐位</label>

              </div>

              <div class="field">

                <div class="button-group checkbox">

                <!--foreach:{$position_list $vo}--> 

                <label class="button<?php if(is_array($position_array)){ if(in_array($vo['id'],$position_array)){ ?> active <?php }} ?>">

                  <input type="checkbox" name="position[]" value="{$vo.id}" <?php if(is_array($position_array)){ if(in_array($vo['id'],$position_array)){ ?> checked="checked" <?php }} ?>  />

                  <span class="icon icon-check text-green"></span> {$vo.name}</label>

                <!--{/foreach}-->  

                </div>

          </div>

            </div>
			<?php if($class_info['cid']==92){ ?>
	<script>
        $(document).ready(function() {
            $('#downurl_botton').click(function(){
                urldialog({
                    title:'文件上传',
                    url:'/admin/index.php/editor/file_upload?id=downurl',
                    width:620,
                    height:240
                });
            });
        });
        </script>            <div class="form-group">

              <div class="label">

                <label>文件上传</label>

              </div>

              <div class="field">

                <input name="image" type="text" value="{$info.image}" class="input" style="width:200px; float:left" id="downurl" reg="\S" msg="文件地址不能为空！">
    &nbsp;&nbsp;
    <input type="button" id="downurl_botton" class="button button-small bg-main" value="选择文件">
    <div class="input-note"></div>

              </div>

            </div>
            <?php }else{ ?>
            <div class="form-group">

              <div class="label">

                <label>缩略图</label>

              </div>

              <div class="field">

                <?php

                if($class_info['expand']==1){

                 	echo module('editor')->get_image_upload('image1','image',false,'',0,1); 

                }else{

                	echo module('editor')->get_image_upload('image1','image');

                } 

                 ?>

                  <input name="image" type="text" class="input" id="image" style="width:220px; float:left" value="{$info.image}"/> 

                  &nbsp;&nbsp;<input type="button" id="image1" class="button button-small bg-main" value="选择图片" />

                  <input type="button" class="button button-small bg-main" onclick="get_one_pic()" value="提取第一张图" />

              </div>

            </div>
			<?php } ?>
            <div id="expand"></div>

            <div class="form-group">

              <div class="label">

                <label>内容</label>

              </div>

              <div class="field">

                 <?php echo module('editor')->get_editor('content'); ?>

          <textarea name="content" style="width:100%; height:350px;" id="content">{$info_data.content html}</textarea>

          <input type="button" onclick="javascript:get_remote_image()" style="margin-top:10px;" class="button button-small bg-main" value="远程图片本地化" />

          <?php echo module('editor')->get_editor_upload('editor_upload','editor_content') ?>

          <input type="button" id="editor_upload" class="button button-small bg-main" style="margin-top:10px;" value="上传图片和文件到编辑器" />

          <!--hook-->

        	<?php module('common')->plus_hook('content','tools',$info);  ?>

      	  <!--hook end-->

              </div>

            </div>
            <?php if($class_info['expand']!=1){ ?>
            <div class="form-group">

              <div class="label">

                <label>作者</label>

              </div>

              <div class="field">

                <input name="author" type="text" class="input" id="author" value="{$info.author}" />

              </div>

            </div>
			<?php } ?>
            <div class="form-group">

              <div class="label">

                <label>内容来源</label>

              </div>

              <div class="field">

                <input name="copyfrom" type="text" class="input" id="copyfrom" value="{$info.copyfrom}" />

              </div>

            </div>

            <?php if(model('user_group')->model_power('content','past')){ ?>

            <div class="form-group">

              <div class="label">

                <label>状态</label>

              </div>

              <div class="field">

              <?php if(!isset($info['status'])){ $info['status']=1; } ?>

                <div class="button-group button-group-small radio">

                <!--if:{$info['status']==1}-->

                  <label class="button active">

                    <input name="status" value="1"   checked="checked" type="radio">

                    <span class="icon icon-check"></span> 发布</label>

                  <label class="button">

                    <input name="status" value="0" type="radio">

                    <span class="icon icon-times"></span> 草稿</label>

                <!--{else}-->

                  <label class="button">

                    <input name="status" value="1" type="radio">

                    <span class="icon icon-check"></span> 发布</label>

                  <label class="button active">

                    <input name="status" value="0" checked="checked" type="radio">

                    <span class="icon icon-times"></span> 草稿</label>

                <!--{/if}-->    

                </div>

              </div>

            </div>

            <?php } ?>

              <?php if(!model('user_group')->model_power('content','past')&&model('user_group')->model_power('content','cancel')){ ?>

              <input name="status" id="status" type="hidden" value="0" />

              <?php } ?>

          </div>

          <div class="tab-panel" id="tab-2">

            <div class="form-group">

              <div class="label">

                <label>SEO标题</label>

              </div>

              <div class="field">

                <input name="subtitle" type="text" class="input" id="subtitle" value="{$info.subtitle}" />

                <div class="input-note"></div>

              </div>

            </div>

            <div class="form-group">

              <div class="label">

                <label>关键词</label>

              </div>

              <div class="field">

              <input name="keywords" type="text" class="input" style="width:290px;" id="keywords" value="{$info.keywords}">

            &nbsp;&nbsp;<input type="button" id="" onclick="javascript:get_keywords()" class="button button-small bg-main" value="提取关键词" />

            <?php if($info['taglink']){ ?>

            &nbsp;&nbsp;<input name="taglink" type="checkbox" value="1" checked="checked" />

            <?php }else{ ?>

            &nbsp;&nbsp;<input name="taglink" type="checkbox" value="1" />

            <?php } ?>

             内容自动链接

                <div class="input-note"></div>

              </div>

            </div>

            <div class="form-group">

              <div class="label">

                <label>描述</label>

              </div>

              <div class="field">

                <textarea name="description" class="input" rows="6" cols="62" id="description">{$info.description}</textarea>

          &nbsp;&nbsp;<input type="button" id="" onclick="javascript:get_description()" class="button button-small bg-main" value="提取描述" />

                <div class="input-note"></div>

              </div>

            </div>

            <div class="form-group">

              <div class="label">

                <label>英文URL名称</label>

              </div>

              <div class="field">

                <input name="urltitle" type="text" size="60" class="input" id="urltitle" value="{$info.urltitle}" />

                <div class="input-note">内容访问的地址</div>

              </div>

            </div>

          </div>

          <div class="tab-panel" id="tab-3">

            <div class="form-group">

              <div class="label">

                <label>访问量</label>

              </div>

              <div class="field">

               <input name="views" type="text" class="input" id="views" value="{$info.views}" />

                <div class="input-note">内容浏览量</div>

              </div>

            </div>

            <div class="form-group">

              <div class="label">

                <label>顺序</label>

              </div>

              <div class="field">

              <input name="sequence" type="text" class="input" id="sequence" value="{$info.sequence}" />

                <div class="input-note">(自定义顺序)</div>

              </div>

            </div>

            <div class="form-group">

              <div class="label">

                <label>跳转到</label>

              </div>

              <div class="field">

               <input name="url" type="text" class="input" id="url" value="{$info.url}" />

                <div class="input-note">URL链接，支持标签</div>

              </div>

            </div>

            <div class="form-group">

              <div class="label">

                <label for="sitename">更新时间</label>

              </div>

              <div class="field">

               <input name="updatetime"  id="updatetime" type="text" class="input" style="width:260px; float:left" value="<?php echo date('Y-m-d H:i:s'); ?>" reg="\S" msg="更新时间不能为空" /><div id="updatetime_button" class="time"></div>

        <script>$('#updatetime_button').calendar({ id:'#updatetime',format:'yyyy-MM-dd HH:mm:ss'});</script>

                <div class="input-note"></div>

              </div>

            </div>

            <div class="form-group">

              <div class="label">

                <label for="sitename">内容模板</label>

              </div>

              <div class="field">

                <input name="tpl" type="text" class="input" id="tpl" value="{$info.tpl}" />

                <div class="input-note">留空采用栏目指定模板</div>

              </div>

            </div>

          </div>

        </div>

        <?php if(model('user_group')->model_power('content','add')||model('user_group')->model_power('content','edit')){ ?>

        <div class="panel-foot">

          <div class="form-button">

            <div id="tips"></div>

            <input name="aid" type="hidden" value="{$info.aid}" />

              <input name="file_id" id="file_id" type="hidden" value="{$file_id}" />

            <button class="button bg-main" type="submit">保存</button>

            <button class="button bg" type="reset">重置</button>

          </div>

        </div>

       <?php } ?> 

      </div>

    </div>

  </form>

{include file="content/common"}